﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="PreviewLoanOrders.ascx.cs" Inherits="Controls_PreviewLoanOrders" %>
<%@ Register TagPrefix="ajax" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit"%>

<asp:Button runat="server" ID="hiddenTargetControlModalPopup" Style="display: none" />
<ajax:ModalPopupExtender 
    runat="server" 
    ID="modalPopup" 
    TargetControlID="hiddenTargetControlModalPopup" 
    PopupControlID="programmaticPopup"
    DropShadow="True" 
    PopupDragHandleControlID="programmaticPopupDragHandle"
    CancelControlID="okButton"
    RepositionMode="RepositionOnWindowResizeAndScroll">
</ajax:ModalPopupExtender>

<asp:Panel runat="server" ID="programmaticPopup" Width="1000px" Style="background-color: white; border: 1px solid Gray; display: none; position: absolute; top: 30%; left:30%;" >

    <div runat="server" ID="programmaticPopupDragHandle" style="border: 1px solid black; text-align:center; font-size:15pt; background-color:Lime; text-transform:uppercase; cursor: move; " >
        <b> <asp:Label ID="WindowTitleLabel" runat="server" Text="GRAFICUL DE ACHITARI"></asp:Label> </b>
    </div>
    <br />

    <asp:Button ID="printLoanButton" runat="server" Text="Printeaza" />        
    <br />
    <div id="PreviewCreditForm" runat="server" style=" max-height:400px; overflow-y:scroll;">
        <asp:GridView ID="previewLoanGridView" runat="server" 
            AutoGenerateColumns="False"  
            CssClass="mGrid"
            PagerStyle-CssClass="pgr"
            AlternatingRowStyle-CssClass="alt"
            onrowdatabound="previewLoanGridView_RowDataBound" 
            ShowFooter="True">
            <Columns>
                <asp:BoundField DataField="nr" HeaderText="Nr" HtmlEncode="False" >
                </asp:BoundField>

                <asp:TemplateField HeaderText="Data">
                    <ItemTemplate>
                        <asp:Label ID="data" runat="server" 
                            Text='<%# ((Eval("data") != null && Eval("data") is DateTime) ?  ((DateTime)Eval("data")).ToString(Constants.Constants.ISODateBackwardDotsFormat) : "") %>'></asp:Label>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:Label ID="totalLabel" runat="server" Text="Totaluri:" CssClass="tableFooter"></asp:Label>
                    </FooterTemplate>
                </asp:TemplateField>
                                                                
                <asp:TemplateField  HeaderText="Procent" >
                    <ItemTemplate>                        
                        <asp:Label ID="percentAmountLabel" runat="server" Text='<%# Bind("percentAmount") %>'></asp:Label> 
                    </ItemTemplate>
                        <FooterTemplate>
                        <asp:Label ID="totalPercentAmountLabel" runat="server" Text="" CssClass="tableFooter"></asp:Label>
                    </FooterTemplate>
                </asp:TemplateField>
                                 
                <asp:TemplateField  HeaderText="Rata Principala" >
                    <ItemTemplate>                        
                        <asp:Label ID="rateAmountLabel" runat="server" Text='<%# Bind("rateAmount") %>'></asp:Label> 
                    </ItemTemplate>
                        <FooterTemplate>
                        <asp:Label ID="totalRateAmountLabel" runat="server" Text="" CssClass="tableFooter"></asp:Label>
                    </FooterTemplate>
                </asp:TemplateField>        

                <asp:TemplateField  HeaderText="Suma Totala" >
                    <ItemTemplate>                        
                        <asp:Label ID="totalAmountLabel" runat="server" Text='<%# Bind("totalAmount") %>'></asp:Label> 
                    </ItemTemplate>
                        <FooterTemplate>
                        <asp:Label ID="totalTotalAmountLabel" runat="server" Text="" CssClass="tableFooter"></asp:Label>
                    </FooterTemplate>                                    
                </asp:TemplateField>    

                <asp:TemplateField  HeaderText="Curs Valutar" >
                    <ItemTemplate>                        
                        <asp:Label ID="changeRateLabel" runat="server" Text='<%# Bind("changeRate") %>'></asp:Label> 
                    </ItemTemplate>                                  
                </asp:TemplateField>


                <asp:TemplateField  HeaderText="Dobinda MDL" >
                    <ItemTemplate>                        
                        <asp:Label ID="percentAmount_RatedLabel" runat="server" Text='<%# Bind("percentAmount_Rated") %>'></asp:Label> 
                    </ItemTemplate>
                        <FooterTemplate>
                        <asp:Label ID="totalPercentAmount_RatedLabel" runat="server" Text="" CssClass="tableFooter"></asp:Label>
                    </FooterTemplate>
                </asp:TemplateField>

                <asp:TemplateField  HeaderText="Corp Credit MDL" >
                    <ItemTemplate>                        
                        <asp:Label ID="rateAmount_RatedLabel" runat="server" Text='<%# Bind("rateAmount_Rated") %>'></asp:Label> 
                    </ItemTemplate>
                        <FooterTemplate>
                        <asp:Label ID="totalRateAmount_RatedLabel" runat="server" Text="" CssClass="tableFooter"></asp:Label>
                    </FooterTemplate>
                </asp:TemplateField> 

                               
                                   
                <asp:TemplateField  HeaderText="Suma Totala MDL" >
                    <ItemTemplate>                        
                        <asp:Label ID="totalAmount_RatedLabel" runat="server" Text='<%# Bind("totalAmount_Rated") %>'></asp:Label> 
                    </ItemTemplate>
                        <FooterTemplate>
                        <asp:Label ID="totalTotalAmount_RatedLabel" runat="server" Text="" CssClass="tableFooter"></asp:Label>
                    </FooterTemplate>                                    
                </asp:TemplateField>     

                <asp:BoundField DataField="remainingAmount" HeaderText="Suma Ramasa"  HtmlEncode="False" >                                 
                </asp:BoundField>
                                
            </Columns>
        </asp:GridView>
    </div>

    <div style="text-align:center;">
        <asp:Button ID="okButton" runat="server" Text="Ok" Width="100px" CausesValidation="false" />
    </div>
</asp:Panel>